﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Main
{
    public partial class Form2 : Form
    {
        public bool isCollspased { get; private set; }

        public Form2()
        {
            InitializeComponent();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void panel4_Paint(object sender, PaintEventArgs e)
        {
          

        }

        private void pictureBox3_Click(object sender, EventArgs e)
        {
            // this.Close();//关闭当前窗口
            // this.Dispose();//释放资源
            // Application.Exit();//消息终止
            System.Environment.Exit(0);//完全释放
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MovePanelCourse(button1);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            MovePanelCourse(button2);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            MovePanelCourse(button3);
        }
        private void huanshuguanli_Click(object sender, EventArgs e)
        {
            MovePanelCourse(huanshuguanli);
        }
        private void tongji_Click(object sender, EventArgs e)
        {
            MovePanelCourse(tongji);
        }
        private void shezhi_Click(object sender, EventArgs e)
        {
            MovePanelCourse(shezhi);
        }
        private void yonghu_Click(object sender, EventArgs e)
        {
            MovePanelCourse(yonghu);
        }

        private void guanyuwomen_Click(object sender, EventArgs e)
        {
            MovePanelCourse(guanyuwomen);
        }
     
      
       

        private void panel5_Paint(object sender, PaintEventArgs e)
        {

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            if (isCollspased)
            {
                panel1.Width = panel1.Width + 10;
                if (panel1.Width >= 194)
                {
                    timer1.Stop();
                    isCollspased = false;
                    this.Refresh();
                }
            }
            else
            {
                panel1.Width = panel1.Width - 10;
                if (panel1.Width <= 55)
                {
                    timer1.Stop();
                    isCollspased = true;
                    this.Refresh();
                }
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void panel2_Paint(object sender, PaintEventArgs e)
        {

        }

        private void realtime_Tick(object sender, EventArgs e)
        {
            DateTime realtime = DateTime.Now;
            labRealtime.Text = realtime.ToString("HH:MM:ss");
        }
        #region Panel的光标移动（PanelCourse)
        private void  MovePanelCourse(Control controlName)
            {
            panelCursor.Top = controlName.Top;
            panelCursor.Height = controlName.Height;
        }



        #endregion

    
    }
}

